import re


class RegularExpression:
    def __init__(self):
        self.URL_HEAD = re.compile('(.*?)http(.*)')
        # regular expression for sputniknews
        self.SPUTNIKNEWS_DIV_M_WHITE = re.compile('<div class="cell__controls(.*?)</div>', re.S)
        self.SPUTNIKNEWS_UNIX_TIME = re.compile('data-unixtime="(.*?)"(.*?)</span>', re.S)
        self.SPUTNIKNEWS_URL_TITLE = re.compile('data-url="(.*?)" data-title="(.*?)"></span>', re.S)
        # regular expression for cls news.
        # <a class="c-666" href="/detail/1593690" target="_blank" rel="noopener noreferrer">
        # 第十四届中国国际储能大会暨展览会将于3月11日至13日在杭州举办。</a>
        self.CLS_HOME_ARTICLE = re.compile('<a class="(.*?)" href="(.*?)" target="(.*?)" '
                                           'rel="noopener noreferrer">(.*?)</a>', re.S)
        # <a href="/detail/1596755" target="_blank" class="f-s-15 c-222 b-c-222222 line2 underline-width1">
        # “史上最火”春节收官：国内游火爆订单量大超疫前 出境游迎生机创近四年峰值</a>
        self.CLS_RANKING_BOX = re.compile('<a href="(.*?)" target="_blank" '
                                          'class="f-s-15 c-222 b-c-222222 line2 underline-width1">(.*?)</a>', re.S)
        self.CLS_FLAG_A = re.compile('<a (.*?)>(.*?)</a>', re.S)
